package com.sun.service.user;

import com.sun.model.entity.UserInfo;
import com.sun.model.example.UserInfoExample;
import com.until.server.ServiceSqlUntil;

/**
 * @author AdminUser
 */
public class UserServiceHelp {
    protected static UserInfoExample userInfoExample=new UserInfoExample();
    public static UserLogin userLogin = new UserLogin();

    private static class UserLogin implements ServiceSqlUntil.GetServerSqlUntil<UserInfo, UserInfoExample> {
        /**
         * 用户登录的业务逻辑代码
         * @param info 传递的 info 对象
         */
        @Override
        public UserInfoExample selectByModelExample(UserInfo info) {
            userInfoExample=new UserInfoExample();
            userInfoExample.createCriteria().andLoginnameEqualTo(info.getLoginname()).andPasswordEqualTo(info.getPassword());
            return userInfoExample;
        }
    }
}
